package jp.co.axisware.taskboard.domain;

import org.springframework.roo.addon.entity.RooEntity;
import org.springframework.roo.addon.javabean.RooJavaBean;
import org.springframework.roo.addon.tostring.RooToString;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import java.util.Set;
import jp.co.axisware.taskboard.domain.Project;
import java.util.HashSet;
import javax.persistence.ManyToMany;
import javax.persistence.CascadeType;

@RooJavaBean
@RooToString
@RooEntity
public class ApplicationUser {

    private String use;

    @NotNull
    @Size(max = 20)
    private String userName;

    @NotNull
    @Size(max = 20)
    private String password;

    @ManyToMany(cascade = CascadeType.ALL)
    private Set<Project> projects = new HashSet<Project>();
}
